<template>
  <van-row class="panel-rectify-operate">
    <van-cell-group title="整改措施落实">
<!--      <van-field required label-width="70px" label="责任部门" input-align="right" readonly :value="rectify.duty_dept.substr(rectify.duty_dept.indexOf('/') + 1)"/>-->
<!--      <van-field required label-width="70px" label="整改措施" input-align="right" readonly/>-->
<!--      <van-field class='input-area' rows="2" autosize type="textarea" maxlength="1000" :value="rectify.rectify_content" show-word-limit readonly/>-->
      <van-field required label-width="70px" label="落实情况" input-align="right" readonly placeholder="请在下方输入整改措施落实情况"/>
      <van-field class='input-area' v-model="commit" rows="2" autosize type="textarea" maxlength="1000" placeholder="请输入整改措施落实情况" show-word-limit/>
      <card-receivers :parentPath="parentDept" :showChildren="1" v-model="receivers"/>
      <van-row class="split-h"/>
      <van-row class='operate-area' gutter="10">
        <van-button type="info" @click="submit">提交</van-button>
      </van-row>
    </van-cell-group>
  </van-row>
</template>

<script>
import CardReceivers from '@/views/common/card/CardReceivers'
import ApiMixin from '@/mixins/ApiMixin'
export default {
  name: 'PanelRectifyExec',
  mixins: [ApiMixin],
  components: { CardReceivers },
  data () {
    return {
      commit: '',
      parentDept: this.rectify.reviewDept,
      formData: this.$vo.createRectifyFormData(),
      receivers: []
    }
  },
  mounted() {
    if (this.rectify.flow_type == 1) {
        this.parentDept = this.rectify.manage_dept
    }
  },
  methods: {
    submit () {
      if (this.commit.trim() === '') {
        this.$dialog.alert({
          message: '请输入整改措施落实情况'
        })
        return
      }
      if (this.receivers.length === 0) {
        this.$dialog.alert({
          message: '请选择接收人员'
        })
        return
      }
      this.formData.op = this.$vo.RectStatus.EXEC
      this.formData.receivers = this.receivers
      this.rectify.rectify_commit = this.commit.trim()
      // 提交
      this.doUpdateRectify()
    }
  }
}
</script>

<style scoped>

</style>
